	#!/usr/bin/perl
	# debugged.pl
	use warnings;
	use strict;
 

	# a test object class
	{
	   package Debugged;
	   use Debuggable;
	   our @ISA = qw(Debuggable);
	   sub new {return bless {}, shift;}
	}
	
	# create a test object from the test class
	my $object = new Debugged;   # defined below so no 'use'
	
	# set debug levels globally, at class level, and on the object
	Debugged->global_debug_level(0);
	Debugged->class_debug_level(2);
	$object->debug_level(1);
	
	# print class and object level debug messages
	Debugged->debug(1, "A class debug message");
	$object->debug(1, "A debug message");
	
	# find current debug levels with _level methods
	print "Class debug level: ", Debugged->class_debug_level, "\n";
	print "Object debug level: ", $object->debug_level, "\n";
	
	# find current debug levels with no?argument 'debug'
	print "Class debug level: ", Debugged->debug, "\n";
	print "Object debug level: ", $object->debug, "\n";
	
	# switch off class and object debug with 1?argument 'debug'
	Debugged->debug(0);
	$object->debug (0);
